import React from 'react'
import {Route, Link, Redirect, Switch} from 'react-router-dom'
import State from './State'

import App1 from './component/App1'
import App2 from './component/App2'
import App12 from './component/App12'

const App = ({number})=> {
    State.reset(number);
    return (
        <div>
            <li><Link to="/a1">A1</Link></li>
            <li><Link to="/a2">A2</Link></li>
            <li><Link to="/a1/a2">A1/A2</Link></li>
            <li><Link to="/a3">A3->A1/A2</Link></li>
            <Switch>
                <Route path="/a1" exact component={App1}></Route>
                <Route path="/a2" component={App2}></Route>
                <Route path="/a1/a2" component={App12}></Route>
                <Redirect to="/a1/a2"/>
            </Switch>
        </div>
    );
}

export default App;